﻿package Framework.Util
{

    public class IDMap extends Object
    {
        private var _messagId:int;
        private var _object:Object;

        public function IDMap()
        {
            this._object = new Object();
            this._messagId = 0;
            return;
        }// end function

        public function insert(param1:Object) : int
        {
            var _loc_3:String = null;
            var _loc_2:int = 1;
            for (_loc_3 in this._object)
            {
                
                if (_loc_2 <= int(_loc_3))
                {
                    _loc_2 = int(_loc_3) + 1;
                }
            }
            this._messagId = _loc_2;
            this._object[this._messagId] = param1;
            return this._messagId;
        }// end function

        public function remove(param1:int) : Boolean
        {
            if (this._object[param1] == undefined)
            {
                return false;
            }
            delete this._object[param1];
            return true;
        }// end function

        public function findAndRemove(param1:int) : Object
        {
            if (this._object[param1] == undefined)
            {
                return null;
            }
            var _loc_2:* = this._object[param1];
            delete this._object[param1];
            return _loc_2;
        }// end function

    }
}
